package Charset;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Charset_01 {
    public static void main(String[] args) throws Exception {
        String name ="abc数字君";
        //byte[] bytes = name.getBytes();默认UTF-8
        byte[] bytes = name.getBytes("GBK");
        System.out.println(bytes.length);
        System.out.println(Arrays.toString(bytes));


        String s = new String(bytes, "GBK");
        System.out.println(s);
    }
}
